import Vue from "vue"
// element-ui.js
import {
  Image,
  Pagination,
  Backtop,
  Card,
  Input,
  Button,
  Dialog,
  Breadcrumb,
  BreadcrumbItem,
  Form,
  FormItem,
  Select,
  Option,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Table,
  TableColumn,
  Message,
  MessageBox
} from "element-ui"

const components = [
  Image,
  Pagination,
  Backtop,
  Card,
  Input,
  Button,
  Dialog,
  Breadcrumb,
  BreadcrumbItem,
  Form,
  FormItem,
  Select,
  Option,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Table,
  TableColumn,
  Message,
  MessageBox
]

const Element = {
  install(Vue) {
    components.forEach((component) => {
      Vue.component(component.name, component)
    })
  }
}

Vue.use(Element)
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm
